@inject OrchardCore.ContentManagement.Metadata.IContentDefinitionManager ContentDefinitionManager

@{
    ContentItem contentItem = Model.ContentItem;
    var contentType = ContentDefinitionManager.GetTypeDefinition(contentItem.ContentType).DisplayName;
}

<div class="widget widget-editor card my-1 @(Model.Inline != true ? "collapsed" : "")">
    <div class="widget-editor-header card-header text-muted">
        <button type="button" class="btn btn-outline-secondary btn-sm widget-editor-btn-toggle widget-editor-btn-collapse"><i class="fa fa-minus" aria-hidden="true"></i></button>
        <button type="button" class="btn btn-outline-secondary btn-sm widget-editor-btn-toggle widget-editor-btn-expand"><i class="fa fa-plus" aria-hidden="true"></i></button>
        @T["{0} — <span class=\"hint\">{1}</span>", contentItem.DisplayText, contentType]
        <div class="btn-group btn-group-sm float-right" role="group">
            @* We don't render an Insert button as the container type is not known here *@
            <button type="button" class="btn btn-secondary widget-delete" itemprop="RemoveUrl"><i class="fa fa-trash" aria-hidden="true"></i></button>
        </div>
    </div>
    <div class="widget-editor-body card-body">
        <div class="col-12">
            @if (Model.Content != null)
            {
                @await DisplayAsync(Model.Content)
            }
            @if (Model.Parts != null)
            {
                @await DisplayAsync(Model.Parts)
            }
        </div>
    </div>

    @* We don't render a footer *@

</div>
